using UnityEngine;

namespace CinemaDirector
{
	[CutsceneItem("UI", "Set Up")]
	public class GGActionSetUpEvent : CinemaGlobalEvent
	{
		public float alpha = 1f;

		public Vector3 scale = Vector3.one;

		public UIWidget widget;

		protected float cachedAlpha;

		protected Vector3 cachedScale;

		public override void Initialize()
		{
			cachedAlpha = widget.alpha;
			cachedScale = widget.cachedTransform.localScale;
		}

		public override void Stop()
		{
			if (!Application.isPlaying)
			{
				widget.alpha = cachedAlpha;
				widget.cachedTransform.localScale = cachedScale;
			}
		}

		public override void Trigger()
		{
			widget.alpha = alpha;
			widget.cachedTransform.localScale = scale;
		}
	}
}
